package com.sky.service.user.impl;

import com.sky.mapper.user.UserSetmealMapper;
import com.sky.pojo.Setmeal;
import com.sky.service.user.UserSetmealService;
import com.sky.vo.DishItemVO;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserSetmealServiceImpl implements UserSetmealService {
    @Autowired
    private UserSetmealMapper userSetmealMapper;
    @Override
    @Cacheable(value = "Setmeal",key = "#categoryId")
    public List<Setmeal> findListByCategoryId(Long categoryId) {
        List<Setmeal> list = userSetmealMapper.findListByCategoryId(categoryId);
        return list;
    }

    @Override
    public List<DishItemVO> findDishBySetmealId(Long setmealId) {
        List<DishItemVO> list = userSetmealMapper.findDishBySetmealId(setmealId);
        return list;
    }
}
